<?
	include '../model/database.php';
	include '../model/xl_dia_diem.php';
	
	$xl_dia_diem = new xl_dia_diem();
	$trang = $_REQUEST['pageNumber'];
	$sodiadiem = $_REQUEST['pageSize'];
	$conditionString = $_REQUEST['_conditionString'];
	$arr = explode("_",$conditionString);
	
	$str = "select*from diadiem where 1 = 1";
	if($arr[0]!="")
		$str .=" and MaTinhThanh = '".$arr[0]."'";
	if($arr[1]!="")
		$str .=" and MaQuanHuyen = '".$arr[1]."'";
	if($arr[2]!="")
		$str .=" and MaNhomDiaDiem = '".$arr[2]."'";
	$start = ($trang-1)*$sodiadiem;
	$str .=" limit $start,$sodiadiem";
	
	$data = $xl_dia_diem->advanceS($str);
	echo json_encode($data);
?>